package com.bc.bczbweb.controller.Ajax;

import com.bc.bccore.redis.RedisService;
import com.bc.bcmodel.consts.RedissCacheKey;
import com.bc.commonentity.common.JsonResult;
import com.bc.bcapi.service.T_SysconfService;
import com.bc.bcmodel.domain.T_SysconfModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.ws.rs.POST;
import java.math.BigInteger;

@RestController
@RequestMapping("ajax/t_sysconf")
public class AjaxT_SysconfController {
    @Autowired
    T_SysconfService t_SysconfService;
    @Resource
    RedisService redisService;

    @POST
    @RequestMapping(value = "add", method = RequestMethod.POST)
    public JsonResult add(T_SysconfModel req) {
        JsonResult js = new JsonResult();
        if (req.getS_key().equals("platform_commission")) {
            redisService.set(RedissCacheKey.Project_Platform_Commission, req.getS_value());
        }
        t_SysconfService.update(req);
        return js;
    }
}